---
import Layout from '@layouts/Layout.astro';
import ListingHero from '@components/things/ListingHero.astro';
import ServiceList from '@components/things/ServiceList.astro';
import Comments from '@components/things/Comments.svelte';
import GitHubDetailedInfo from '@components/things/GitHubDetailedInfo.astro';
import SecurityDetailedInfo from '@components/things/SecurityDetailedInfo.astro';
import PrivacyPolicyDetails from '@components/things/PrivacyPolicyDetails.astro';
import WebsiteDetailedInfo from '@components/things/WebsiteDetailedInfo.astro';
import DockerDetailedInfo from '@components/things/DockerDetailedInfo.astro';
import IosAppDetailedInfo from '@components/things/IosAppDetailedInfo.astro';
import AndroidAppDetailedInfo from '@components/things/AndroidDetailedInfo.astro';
import DiscordDetailedInfo from '@components/things/DiscordDetailedInfo.astro';
import RedditDetailedInfo from '@components/things/RedditDetailedInfo.astro';
import SocialShare from '@components/form/Social.astro';
import DataActions from '@components/things/DataActions.svelte';
import type { AwesomePrivacy, Section, Service } from '../types/Service';
import { fetchData, slugify } from '@utils/fetch-data';
import { codebergUrl } from '@utils/parse-markdown';
import { fetchChangelog } from '@utils/fetch-changelog';
import { fetchGitHubStats } from '@utils/fetch-repo-info';
import { fetchSecurityReport } from '@utils/fetch-security-info';
import { fetchTosdrPrivacy } from '@utils/fetch-privacy-policy';
import { fetchWebsiteInfo } from '@utils/fetch-website-info';
import { fetchDockerData } from '@utils/fetch-docker-instructions';
import { fetchIosInfo } from '@utils/fetch-ios-info';
import { fetchAndroidInfo } from '@utils/fetch-android-info';
import { fetchPlexusInfo } from '@utils/fetch-plexus-info';
import { fetchDiscordInfo } from '@utils/fetch-discord-info';
import { fetchRedditInfo } from '@utils/fetch-reddit-info';
import { site } from '@utils/config';
import { apiBase, serviceSlug } from '@utils/api-config';
import Button from '@components/form/Button.astro';
interface Props extends Service {
slug: string;
parentSection: Section;
categoryName: string;
}
const {
name,
description,
url,
github,
codeberg,
git,
tosdrId,
discordInvite,
subreddit,
iosApp,
androidApp,
parentSection,
categoryName,
} = Astro.props;
const makeKeyWordTag = () => {
const keywords = [
`open source ${parentSection.name}`,
`${parentSection.name} comparison`,
...(parentSection.alternativeTo || []).map(
(alt: string) => `${alt} alternative`,
),
...(parentSection.services || []).map((serv: Service) => `${serv.name} vs`),
'private',
'ad free',
'encrypted',
'open source software',
'privacy respecting apps',
'free tools',
];
return keywords.join(', ');
};
const makePageTitle = () => {
return `${name} | ${parentSection.name} | ${categoryName} | Awesome Privacy`;
};
const makeBreadcrumbs = () => {
return [
{ name: 'Home', item: '/' },
{ name: categoryName, item: slugify(categoryName) },
{
name: parentSection.name,
item: `${slugify(categoryName)}/${slugify(parentSection.name)}`,
},
{
name: name,
item: `${slugify(categoryName)}/${slugify(parentSection.name)}/${slugify(name)}`,
},
];
};
const makeDescriptionTag = () => {
let desc = `Analysis of ${name}, and other privacy-respecting ${parentSection.name} `;
if (parentSection.services) {
desc += `Compare ${parentSection.services.map((s: Service) => s.name).join(' vs ')} more apps. `;
}
if (parentSection.alternativeTo && parentSection.alternativeTo.length > 0) {
desc += `The best secure encrypted alternatives to ${parentSection.alternativeTo.join(', ')}. `;
}
desc += 'All this, and many more free and awesome tools and software.';
return desc;
};
const filterServices = () => {
return parentSection.services.filter((s: Service) => s.name !== name);
};
export async function getStaticPaths() {
const pages = await fetchData().then((data) => {
const results: Array = [];
if (!data || !data.categories) return results;
(data as AwesomePrivacy).categories.forEach((category) => {
category.sections.forEach((section) => {
const services = (section.services || []).map((service) => {
return {
slug: `${slugify(category.name)}/${slugify(section.name)}/${slugify(service.name)}`,
parentSection: section,
categoryName: category.name,
...service,
};
});
results.push(...services);
});
});
return results;
});
return pages.map((props: Props) => {
return { params: { listing: props.slug }, props };
});
}
const makePaginationLinks = () => {
const allServices = parentSection.services || [];
const index = allServices.findIndex((item) => item.name === name);
const previousItem = index > 0 ? allServices[index - 1].name : null;
const nextItem =
index < allServices.length - 1 ? allServices[index + 1].name : null;
return { previous: previousItem, next: nextItem };
};
const { previous, next } = makePaginationLinks();
const ignoredSites = ['github.com', 'wikipedia.'];
const githubData = github ? await fetchGitHubStats(github) : null;
const securityData = github ? await fetchSecurityReport(github) : null;
const hasSecurityData =
!!securityData &&
((securityData.scorecard.available &&
securityData.scorecard.checks.length > 0) ||
securityData.advisories.count > 0);
const privacyData = tosdrId ? await fetchTosdrPrivacy(tosdrId) : null;
const iosData = iosApp ? await fetchIosInfo(iosApp) : null;
const androidData = androidApp ? await fetchAndroidInfo(androidApp) : null;
const plexusData = androidApp ? await fetchPlexusInfo(androidApp) : null;
const discordData = discordInvite
? await fetchDiscordInfo(discordInvite)
: null;
const redditData = subreddit ? await fetchRedditInfo(subreddit) : null;
const dockerData = await fetchDockerData(name);
const websiteData =
url && !ignoredSites.some((s) => url.includes(s))
? await fetchWebsiteInfo(url)
: null;
const serviceHistory = await fetchChangelog().then(({ entries }) => {
const isMatch = (c: { name: string; category: string; section: string }) =>
c.name === name &&
c.category === categoryName &&
c.section === parentSection.name;
const isHere = (m: {
name: string;
to: { category: string; section: string };
}) =>
m.name === name &&
m.to.category === categoryName &&
m.to.section === parentSection.name;
const results: Array<{
date: string;
type: 'added' | 'removed' | 'modified' | 'moved' | 'renamed';
fields?: string[];
from?: { category: string; section: string };
previousName?: string;
pr?: import('@utils/fetch-changelog').ChangelogPr | null;
}> = [];
for (const e of entries) {
const s = e.changes?.services;
const added = (s?.added || []).find(isMatch);
const removed = (s?.removed || []).find(isMatch);
const modified = (s?.modified || []).find(isMatch);
const moved = (s?.moved || []).find(isHere);
const renamed = (s?.renamed || []).find(isHere);
if (added) results.push({ date: e.date, type: 'added', pr: e.pr });
else if (removed) results.push({ date: e.date, type: 'removed', pr: e.pr });
else if (modified)
results.push({
date: e.date,
type: 'modified',
fields: modified.fields,
pr: e.pr,
});
else if (renamed)
results.push({
date: e.date,
type: 'renamed',
previousName: renamed.previousName,
from: renamed.from,
pr: e.pr,
});
else if (moved)
results.push({ date: e.date, type: 'moved', from: moved.from, pr: e.pr });
}
return results;
});
const findPrivacyPolicyLink = () => {
if (!privacyData) return null;
const docs = privacyData?.parameters?.documents;
if (docs) {
const pp = (docs || []).find((doc) =>
doc.name.toLowerCase().includes('privacy policy'),
);
if (pp) return pp.url;
}
return `https://tosdr.org/en/service/${tosdrId}`;
};
const privacyPolicyLink = findPrivacyPolicyLink();
const catSlug = slugify(categoryName);
const secSlug = slugify(parentSection.name);
const getApiEndpoint = () => {
return `${apiBase}/v1/services/${serviceSlug(name)}`;
};
const makeSoftwareSchema = () => {
const operatingSystem = [
iosApp && 'iOS',
androidApp && 'Android',
url && 'Web',
].filter(Boolean);
const plainDescription = (description || '')
.replace(/\[([^\]]+)\]\([^)]+\)/g, '$1')
.replace(/[*_`~]/g, '')
.trim();
const codeRepository = github
? `https://github.com/${github}`
: codeberg
? codebergUrl(codeberg)
: git || null;
return {
'@context': 'https://schema.org',
'@type': 'SoftwareApplication',
name,
description: plainDescription || makeDescriptionTag(),
url,
applicationCategory: parentSection.name,
...(operatingSystem.length && {
operatingSystem: operatingSystem.join(', '),
}),
...(codeRepository && { codeRepository }),
};
};
---
{
privacyData && privacyData.parameters?.points?.length > 0 && (
)
}
{
github && githubData && (
)
}
{
hasSecurityData && securityData && (
)
}
{
websiteData && (
)
}
{
((androidData && !androidData.error) || plexusData) && (
)
}
{
iosData &&
typeof iosData === 'object' &&
Object.keys(iosData).length > 0 && (
)
}
{
dockerData && dockerData.found && (
)
}
{
(discordData || redditData) && (
{name} Socials
{discordData && }
{redditData && }
)
}
More {parentSection.name}
About the Data: {name}
API
You can access {name}'s data programmatically via our API. Simply make a GET request to:
{getApiEndpoint()}
The REST API is free, no-auth and CORS-enabled. To learn more, view the API Docs or read the API Usage Guide.
Share {name}
Help your friends compare {parentSection.name}, and pick
privacy-respecting software and services.
Share {name} and Awesome Privacy with your network!